package com.hqyj.controller;

import com.hqyj.pojo.TableMenu;
import com.hqyj.service.TableMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@RequestMapping("/table")
@Controller
public class TableMenuController {
    @Autowired
    private TableMenuService service;

    //查看已点的菜
    @RequestMapping("/myMenu")
    public String myMenu() {
        return "table/myMenu";
    }

    @RequestMapping("/myMenuAjax")
    @ResponseBody
    public HashMap<String, Object> myMenuAjax(TableMenu tableMenu) {
        return service.myMenuList(tableMenu);
    }

    //结账
    @RequestMapping("/checkAjax")
    @ResponseBody
    public HashMap<String, Object> checkAjax(String arrId) {
        return service.checkout(arrId);
    }

    //做菜
    @RequestMapping("/cookDish")
    public String cookDish() {
        return "cook/cookDish";
    }

    @RequestMapping("/cookDishAjax")
    @ResponseBody
    public HashMap<String, Object> cookDishAjax(String arrId) {
        return service.cook(arrId);
    }

    @RequestMapping("/myCookAjax")
    @ResponseBody
    public HashMap<String, Object> myCookAjax(TableMenu tableMenu) {
        return service.myCook(tableMenu);
    }

    //账单明细
    @RequestMapping("/money-select")
    public String moneyClosed(){
        return "money/money-select";
    }

    //查询已付款
    @RequestMapping("/moneyListAjax")
    @ResponseBody
    public HashMap<String, Object> moneyList(TableMenu tableMenu) {
        return service.moneyList(tableMenu);
    }

    //查询已付款
//    @RequestMapping("/priceAjax")
//    @ResponseBody
//    public Integer priceAjax(TableMenu tableMenu) {
//        return service.Money(tableMenu);
//    }

}
